package com.apgblogs.springbootstudyse01.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xiaomianyang
 * @description
 * @date 2019-11-14 10:01
 */
@RestController
public class IndexController {

    /**
     * @description 支持get和post请求
     * @author xiaomianyang
     * @date 2019-11-14 12:17
     * @param []
     * @return java.lang.String
     */
    @RequestMapping("/")
    public String index(){
        return "index";
    }

    /**
     * @description get请求
     * @author xiaomianyang
     * @date 2019-11-14 12:17
     * @param []
     * @return java.lang.String
     */
    @GetMapping("/hello")
    public String hello(){
        return "hello world";
    }

    /**
     * @description post请求
     * @author xiaomianyang
     * @date 2019-11-14 12:17
     * @param []
     * @return java.lang.String
     */
    @PostMapping("/hello")
    public String postHello(){
        return "hello post world!";
    }
}
